All Questions
Tagged with circular-dependencyobject-oriented-design
8 questions
-1votes
2answers
161views
Decoupling 2 Tightly Coupled Classes, Basket and Discount
I have two tightly coupled classes Basket and Discount. Basket is responsible for keeping track of the items in a shopping basket, keeping track of any discount codes applied, and calculating the ...
3votes
2answers
3kviews
Is circular reference with Typescript array properties bad design?
I understand that having circular dependency can be bad design. However, I have a question regarding a certain class structure. As an example: ocean.ts import {Boat} from './boat'; export class ...
3votes
4answers
685views
Circular Interface references
I've heard circular references are generally an issue, however I was wondering if this was true for interfaces that reference other interfaces, for example: IQuestion{ IAnswer getCorrectAnswer(); ...
3votes
3answers
209views
What is the motivation or usage to create a interface use once only just for breaking circular dependency?
I understand if 2 classes have circular dependency, eg: public class MyWindow{ public MyWindow(){ new MyDialog(this); } public onDialogResponse(int option){ } } public class ...
1vote
2answers
1kviews
Help with getting rid of circular dependency
I have the following circular dependency that I'd like to eliminate. I think I must have a flaw in my design. And I'd much appreciate any feedback on how to fix this. My circular dependency comes ...
0votes
2answers
2kviews
How to remove circular reference when there is inter-dependence
I made an extensive research in previousv related questions, but since my questions is somewhat peculiar, I decided to create this new one. I am implementing a visualisation application (in JS). ...
52votes
3answers
121kviews
How to solve circular dependency?
I have three classes that are circular dependant to each other: TestExecuter execute requests of TestScenario and save a report file using ReportGenerator class. So: TestExecuter depends on ...
-2votes
1answer
764views
Base Class, with method that returns Derived Class. design flaw?
I'm writing a Math equation solver in python (for fun). The first design that came to my mind: Expression: base class for every item in an equation (maybe bad name). BinaryExpression extends ...